﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebFramework.ActionResults
{
    public class TextResult : IActionResult
    {
        private string _text;

        public TextResult(string input)
        {
            _text = input;
        }

        public static implicit operator TextResult(string input)
        {
            return new TextResult(input);
        }

        public void Render(HttpResponse response)
        {
            response.ContentType = "text/plain";
            response.Write(_text);
        }
    }
}